<!doctype html>
<html >

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
	</head>

	<body>
	
		
		<nav class="mui-bar mui-bar-tab">
					<a class="mui-tab-item mui-active" href="#tabbar" id="home">
						<span class="mui-icon mui-icon-home"></span>
						<span class="mui-tab-label">扫码</span>
					</a>
					<a class="mui-tab-item" href="#tabbar-with-chat" id="sj">
						<span class="mui-icon mui-icon-email"></span>
						<span class="mui-tab-label">开通升级</span>
					</a> 
					<a class="mui-tab-item" href="#tabbar-with-chat" id="sjed">
						<span class="mui-icon mui-icon-email"></span>
						<span class="mui-tab-label">可升级列表</span>
					</a> 
					<a class="mui-tab-item" href="#tabbar-with-chat" id="umanager">
						<span class="mui-icon mui-icon-email"></span>
						<span class="mui-tab-label">用户管理</span>
					</a> 
					
				
					<a class="mui-tab-item" href="#tabbar-with-map" id="myhome">
						<span class="mui-icon mui-icon-contact"></span>
						<span class="mui-tab-label">我的</span>
					</a>
		</nav>
		<div class="mui-content">
			
		</div>
		<script src="js/mui.js"></script>
		<script type="text/javascript" charset="utf-8">
		  (function($, doc) {
			  
			  var userinfo = JSON.parse(localStorage.getItem('userinfo') || '{}');
			console.log("userinfo")
			  if(!userinfo.accessToken){
			  	$.toast("退出登录")
			  	setTimeout(function(){	
			  		// location.href="login.html";
					mui.openWindow({url:'login.html',extras:{id:'100'}});
			  	},1000)
			  }
			  
		  	function changeview(id){
		  		  var view=plus.webview.getWebviewById(id);
		  		  view.show();
		  	  }	  	
		  	  $.init({
		  		statusBarBackground: '#f7f7f7'
		  	 
		  	});
			 var subpages=['a.html','b.html','c.html','d.html','e.html'];
			 var Index = 0;
			$.plusReady(function(){ //获取当前页面所属的Webview窗口对象
			   
                var self = plus.webview.currentWebview();
                for(var i = 0; i < 5; i++) {
                    //创建webview子页
                    var sub = plus.webview.create(
                        subpages[i], //子页url
                        subpages[i], //子页id
                        {
                            top: '0', //设置距离顶部的距离
                            bottom: '50px' //设置距离底部的距离
                        }
                    );
                    //如不是我们设置的默认的子页则隐藏，否则添加到窗口中
                    if(i != Index) {
                        sub.hide();
                    }
                    //将webview对象填充到窗口
                    self.append(sub);
                }
				var index = plus.webview.getWebviewById('a.html');
				index.show();
				//监听
				document.getElementById('home').addEventListener('tap',function(){
					changeview('a.html')
				});
				document.getElementById('sj').addEventListener('tap',function(){
					changeview('b.html')
				});
				document.getElementById('sjed').addEventListener('tap',function(){
					changeview('c.html')
				});
				document.getElementById('umanager').addEventListener('tap',function(){
					changeview('d.html')
				});
				document.getElementById('myhome').addEventListener('tap',function(){
					changeview('e.html')
				});
			});

			
			
		  }(mui, document));
		</script>
		
		
		
	</body>

</html>
